from flask import Blueprint, request
from .detail_admin import Detail

app_admin = Blueprint('app_admin',__name__)

@app_admin.route('/time',methods=['GET'])
def admin_detail():
    info = request.args 
    start_time = info.get('start_time')
    with Detail()as D:
        if not start_time==None:
            result = D.start_time_details(start_time)
            return result 
    return '请发起你的请求'

@app_admin.route('/point',methods=['GET'])
def admin_detail_time():
    info = request.args 
    start_point = info.get('start_point')
    with Detail()as D:
        if not start_point == None:
            result = D.start_point_detail(start_point)
            return result
    
@app_admin.route('/destination',methods=['GET'])
def admin_detail_times():
    info = request.args 
    destination = info.get('destination')
    with Detail()as D:
        if not destination == None:
            result = D.destination_detail(destination)
            return result

@app_admin.route('/pick_up',methods=['GET'])
def admin_detail_timess():
    info = request.args 
    pick_up_point = info.get('pick_up_point')
    with Detail()as D:
        if not pick_up_point == None:
            result = D.pick_up_point_detail(pick_up_point)
            return result